package com.example.dao;

import com.example.pojo.Deparment;
import org.springframework.stereotype.Repository;

import java.util.Collection;
import java.util.HashMap;
import java.util.Map;

/**
 * Created by Administrator on 2016/9/23/023.
 */
@Repository
public class DepartmentDao {
    private  static Map<Integer,Deparment> deparmentMap=null;
    static {
        deparmentMap=new HashMap<Integer, Deparment>();
        deparmentMap.put(101,new Deparment(101,"D-AA"));
        deparmentMap.put(102,new Deparment(102,"D-BB"));
        deparmentMap.put(103,new Deparment(103,"D-CC"));
        deparmentMap.put(104,new Deparment(104,"D-DD"));
        deparmentMap.put(105,new Deparment(105,"D-EE"));
    }
    public Collection<Deparment> getDepartments(){
        return  deparmentMap.values();
    }
    public Deparment getDepartment(Integer id){
        return  deparmentMap.get(id);
    }
}
